home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000112_icon-group-sender_Thu Oct 26 07:59:42 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9QEvkf22309
  4.     for icon-group-addresses; Thu, 26 Oct 2000 07:57:46 -0700 (MST)
  5. Message-Id: <200010261457.e9QEvkf22309@baskerville.CS.Arizona.EDU>
  6. From: Bob Ardler <ardler@argonet.co.uk>
  7. To: icon-group@cs.arizona.edu
  8. Date: Thu, 26 Oct 2000 12:32:54 +0100
  9. Subject: Re: Yet another Newbie question....
  10. User-Agent: Pluto/2.02b (RISC-OS/3.60)
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13. Content-Length: 1540
  14.  
  15. Shamim Mohamed <shamim@drones.com> :
  16. > symbiot@my-deja.com :
  17. > > if member(&letters,line[index]) then totalcount +:= 1
  18. > > barfed with
  19. > > set or table expected.
  20. > > Offending value &letters
  21. > > Isn't &letters a cset? You can use it in other "set" functions,
  22. > > can't you? What am I missing?
  23. > Homework? You really need a book on Icon. If you don't want to buy
  24. > the text, download and read Tom Christopher's free on-line book.
  25. > There's a link to it from the U of A Icon web page
  26. > http://www.cs.arizona.edu/icon/.
  27.  
  28. > String scanning is the most natural way of doing this. What does
  29. > this code do?
  30.  
  31. >    line ? while tab(upto(&letters)) do move(1)
  32. Intimidates? Sends you screaming come back awk, come back perl, all
  33. is forgiven?
  34.  
  35. Shamin is right in every respect; yet, as a permanent beginner I fell
  36. to the earth twitching and frothing at that "natural" line. Neither
  37. Griswold & Griswold nor Christopher (both excellent and friendly)
  38. always help, say, a student coming from a conventional language who
  39. wants to write a conventional 'if' statement and expects to find a
  40. simple analogue for the predicates s/he's used to.
  41.  
  42. G&G (The Icon Programming Language, see www.peer-to-peer.com) does
  43. point out that member(X,x) requires X to be a set or table, and a
  44. cset isn't a set. Both books also list the operations on csets (union
  45. ++, intersection **, difference -- and complement ~), but I don't
  46. know where or whether they explain that you have to make your own
  47. cset analogue for member() using any() or not-empty intersection or
  48. whatever.
  49.  
  50.  
  51.